
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>基础04 运算 · Python-Tutorial</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-theme-comscore/test.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="04.html" />
    
    
    <link rel="prev" href="03.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        <li class="header">Python基础</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="基础.html">
            
                <a href="基础.html">
            
                    
                    Python基础
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="01.html">
            
                <a href="01.html">
            
                    
                    基础01 Hello World!
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.1" data-path="01.html">
            
                <a href="01.html#python命令行">
            
                    
                    Python命令行
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.2" data-path="01.html">
            
                <a href="01.html#写一段小程序">
            
                    
                    写一段小程序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.3" data-path="01.html">
            
                <a href="01.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="02.html">
            
                <a href="02.html">
            
                    
                    基础02 基本数据类型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.2.1" data-path="02.html">
            
                <a href="02.html#变量不需要声明">
            
                    
                    变量不需要声明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2.2" data-path="02.html">
            
                <a href="02.html#回收变量名">
            
                    
                    回收变量名
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2.3" data-path="02.html">
            
                <a href="02.html#基本数据类型">
            
                    
                    基本数据类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2.4" data-path="02.html">
            
                <a href="02.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="03.html">
            
                <a href="03.html">
            
                    
                    基础03 序列
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.3.1" data-path="03.html">
            
                <a href="03.html#sequence-序列">
            
                    
                    sequence 序列
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.2" data-path="03.html">
            
                <a href="03.html#元素的引用">
            
                    
                    元素的引用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.3" data-path="03.html">
            
                <a href="03.html#其他引用方式">
            
                    
                    其他引用方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.4" data-path="03.html">
            
                <a href="03.html#字符串是元组">
            
                    
                    字符串是元组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.5" data-path="03.html">
            
                <a href="03.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="1.2.4" data-path="04.html">
            
                <a href="04.html">
            
                    
                    基础04 运算
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.4.1" data-path="04.html">
            
                <a href="04.html#数学运算">
            
                    
                    数学运算
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.2" data-path="04.html">
            
                <a href="04.html#分支">
            
                    
                    分支
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.3" data-path="04.html">
            
                <a href="04.html#逻辑运算">
            
                    
                    逻辑运算
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.4" data-path="04.html">
            
                <a href="04.html#pythonic-数据交换">
            
                    
                    Pythonic 数据交换
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.5" data-path="04.html">
            
                <a href="04.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="05.html">
            
                <a href="05.html">
            
                    
                    基础05 缩进和选择
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.5.1" data-path="05.html">
            
                <a href="05.html#缩进">
            
                    
                    缩进
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5.2" data-path="05.html">
            
                <a href="05.html#if语句">
            
                    
                    if语句
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5.3" data-path="05.html">
            
                <a href="05.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="06.html">
            
                <a href="06.html">
            
                    
                    基础06 循环
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.6.1" data-path="06.html">
            
                <a href="06.html#for循环">
            
                    
                    for循环
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6.2" data-path="06.html">
            
                <a href="06.html#while循环">
            
                    
                    while循环
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6.3" data-path="06.html">
            
                <a href="06.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="07.html">
            
                <a href="07.html">
            
                    
                    基础07 函数
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.7.1" data-path="07.html">
            
                <a href="07.html#函数的定义">
            
                    
                    函数的定义
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7.2" data-path="07.html">
            
                <a href="07.html#函数调用和参数传递">
            
                    
                    函数调用和参数传递
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7.3" data-path="07.html">
            
                <a href="07.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="08.html">
            
                <a href="08.html">
            
                    
                    基础08 面向对象的基本概念
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.8.1" data-path="08.html">
            
                <a href="08.html#相近对象，归为类">
            
                    
                    相近对象，归为类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.2" data-path="08.html">
            
                <a href="08.html#动作">
            
                    
                    动作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.3" data-path="08.html">
            
                <a href="08.html#子类">
            
                    
                    子类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8.4" data-path="08.html">
            
                <a href="08.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.9" data-path="09.html">
            
                <a href="09.html">
            
                    
                    基础09 面向对象的进一步拓展
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.9.1" data-path="09.html">
            
                <a href="09.html#调用类的其它信息">
            
                    
                    调用类的其它信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9.2" data-path="09.html">
            
                <a href="09.html#init方法">
            
                    
                    __init__()方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9.3" data-path="09.html">
            
                <a href="09.html#对象的性质">
            
                    
                    对象的性质
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.10" data-path="10.html">
            
                <a href="10.html">
            
                    
                    基础10 反过头来看看
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.10.1" data-path="10.html">
            
                <a href="10.html#list是一个类">
            
                    
                    list是一个类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10.2" data-path="10.html">
            
                <a href="10.html#运算符是特殊方法">
            
                    
                    运算符是特殊方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10.3" data-path="10.html">
            
                <a href="10.html#下一步">
            
                    
                    下一步
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.10.4" data-path="10.html">
            
                <a href="10.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">Python进阶</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="进阶.html">
            
                <a href="进阶.html">
            
                    
                    进阶
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" data-path="intermediate01.html">
            
                <a href="intermediate01.html">
            
                    
                    进阶01 词典
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1.1" data-path="intermediate01.html">
            
                <a href="intermediate01.html#基本概念">
            
                    
                    基本概念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.1.2" data-path="intermediate01.html">
            
                <a href="intermediate01.html#词典元素的循环调用">
            
                    
                    词典元素的循环调用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.1.3" data-path="intermediate01.html">
            
                <a href="intermediate01.html#词典的常用方法">
            
                    
                    词典的常用方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.1.4" data-path="intermediate01.html">
            
                <a href="intermediate01.html#词典排序">
            
                    
                    词典排序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.1.5" data-path="intermediate01.html">
            
                <a href="intermediate01.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="intermediate02.html">
            
                <a href="intermediate02.html">
            
                    
                    进阶02 文本文件的输入输出
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.2.1" data-path="intermediate02.html">
            
                <a href="intermediate02.html#创建文件对象">
            
                    
                    创建文件对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.2" data-path="intermediate02.html">
            
                <a href="intermediate02.html#文件对象的方法">
            
                    
                    文件对象的方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2.3" data-path="intermediate02.html">
            
                <a href="intermediate02.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.3" data-path="intermediate03.html">
            
                <a href="intermediate03.html">
            
                    
                    进阶03 模块
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.3.1" data-path="intermediate03.html">
            
                <a href="intermediate03.html#引入模块">
            
                    
                    引入模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.2" data-path="intermediate03.html">
            
                <a href="intermediate03.html#搜索路径">
            
                    
                    搜索路径
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.3" data-path="intermediate03.html">
            
                <a href="intermediate03.html#模块包">
            
                    
                    模块包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3.4" data-path="intermediate03.html">
            
                <a href="intermediate03.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.4" data-path="intermediate04.html">
            
                <a href="intermediate04.html">
            
                    
                    进阶04 函数的参数对应
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.4.1" data-path="intermediate04.html">
            
                <a href="intermediate04.html#关键字传递">
            
                    
                    关键字传递
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4.2" data-path="intermediate04.html">
            
                <a href="intermediate04.html#参数默认值">
            
                    
                    参数默认值
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4.3" data-path="intermediate04.html">
            
                <a href="intermediate04.html#包裹传递">
            
                    
                    包裹传递
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4.4" data-path="intermediate04.html">
            
                <a href="intermediate04.html#解包裹">
            
                    
                    解包裹
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4.5" data-path="intermediate04.html">
            
                <a href="intermediate04.html#混合">
            
                    
                    混合
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4.6" data-path="intermediate04.html">
            
                <a href="intermediate04.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.5" data-path="intermediate05.html">
            
                <a href="intermediate05.html">
            
                    
                    进阶05 循环设计
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.5.1" data-path="intermediate05.html">
            
                <a href="intermediate05.html#range">
            
                    
                    range()
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.5.2" data-path="intermediate05.html">
            
                <a href="intermediate05.html#enumerate">
            
                    
                    enumerate()
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.5.3" data-path="intermediate05.html">
            
                <a href="intermediate05.html#zip">
            
                    
                    zip()
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.5.4" data-path="intermediate05.html">
            
                <a href="intermediate05.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.6" data-path="intermediate06.html">
            
                <a href="intermediate06.html">
            
                    
                    进阶06 循环对象
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.6.1" data-path="intermediate06.html">
            
                <a href="intermediate06.html#什么是循环对象">
            
                    
                    什么是循环对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.6.2" data-path="intermediate06.html">
            
                <a href="intermediate06.html#迭代器">
            
                    
                    迭代器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.6.3" data-path="intermediate06.html">
            
                <a href="intermediate06.html#生成器">
            
                    
                    生成器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.6.4" data-path="intermediate06.html">
            
                <a href="intermediate06.html#表推导">
            
                    
                    表推导
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.6.5" data-path="intermediate06.html">
            
                <a href="intermediate06.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.7" data-path="intermediate07.html">
            
                <a href="intermediate07.html#">
            
                    
                    进阶07 函数对象
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.7.1" data-path="intermediate07.html">
            
                <a href="intermediate07.html#lambda函数">
            
                    
                    lambda函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.2" data-path="intermediate07.html">
            
                <a href="intermediate07.html#函数作为参数传递">
            
                    
                    函数作为参数传递
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.3" data-path="intermediate07.html">
            
                <a href="intermediate07.html#map函数">
            
                    
                    map()函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.4" data-path="intermediate07.html">
            
                <a href="intermediate07.html#filter函数">
            
                    
                    filter()函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.5" data-path="intermediate07.html">
            
                <a href="intermediate07.html#reduce函数">
            
                    
                    reduce()函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7.6" data-path="intermediate07.html">
            
                <a href="intermediate07.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.8" data-path="intermediate08.html">
            
                <a href="intermediate08.html#">
            
                    
                    进阶08 异常处理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.8.1" data-path="intermediate08.html">
            
                <a href="intermediate08.html#异常处理">
            
                    
                    异常处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.8.2" data-path="intermediate08.html">
            
                <a href="intermediate08.html#抛出异常">
            
                    
                    抛出异常
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.8.3" data-path="intermediate08.html">
            
                <a href="intermediate08.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.1.9" data-path="intermediate09.html">
            
                <a href="intermediate09.html#">
            
                    
                    进阶09 动态类型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.9.1" data-path="intermediate09.html">
            
                <a href="intermediate09.html#动态类型">
            
                    
                    动态类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.9.2" data-path="intermediate09.html">
            
                <a href="intermediate09.html#从动态类型看函数的参数传递">
            
                    
                    从动态类型看函数的参数传递
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.9.3" data-path="intermediate09.html">
            
                <a href="intermediate09.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="快速教程总结.html">
            
                <a href="快速教程总结.html">
            
                    
                    快速教程总结
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="小题目 针对快速教程.html">
            
                <a href="小题目 针对快速教程.html">
            
                    
                    小题目 针对快速教程
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Python深入</li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="深入.html">
            
                <a href="深入.html">
            
                    
                    Python深入
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.1" data-path="深入01 特殊方法与多范式.html">
            
                <a href="深入01 特殊方法与多范式.html#python深入01-特殊方法与多范式">
            
                    
                    深入01 特殊方法与多范式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.1.1" data-path="深入01 特殊方法与多范式.html">
            
                <a href="深入01 特殊方法与多范式.html#运算符">
            
                    
                    运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.1.2" data-path="深入01 特殊方法与多范式.html">
            
                <a href="深入01 特殊方法与多范式.html#内置函数">
            
                    
                    内置函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.1.3" data-path="深入01 特殊方法与多范式.html">
            
                <a href="深入01 特殊方法与多范式.html#表list元素引用">
            
                    
                    表(list)元素引用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.1.4" data-path="深入01 特殊方法与多范式.html">
            
                <a href="深入01 特殊方法与多范式.html#函数">
            
                    
                    函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.1.5" data-path="深入01 特殊方法与多范式.html">
            
                <a href="深入01 特殊方法与多范式.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.1.2" data-path="深入02 上下文管理器.html">
            
                <a href="深入02 上下文管理器.html">
            
                    
                    深入02 上下文管理器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.2.1" data-path="深入02 上下文管理器.html">
            
                <a href="深入02 上下文管理器.html#关闭文件">
            
                    
                    关闭文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.2.2" data-path="深入02 上下文管理器.html">
            
                <a href="深入02 上下文管理器.html#自定义">
            
                    
                    自定义
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.2.3" data-path="深入02 上下文管理器.html">
            
                <a href="深入02 上下文管理器.html#总结：">
            
                    
                    总结：
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.1.3" data-path="深入03 对象的属性.html">
            
                <a href="深入03 对象的属性.html">
            
                    
                    深入03 对象的属性
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.3.1" data-path="深入03 对象的属性.html">
            
                <a href="深入03 对象的属性.html#属性的dict系统">
            
                    
                    属性的__dict__系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.3.2" data-path="深入03 对象的属性.html">
            
                <a href="深入03 对象的属性.html#特性">
            
                    
                    特性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.3.3" data-path="深入03 对象的属性.html">
            
                <a href="深入03 对象的属性.html#使用特殊方法getattr">
            
                    
                    使用特殊方法__getattr__
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.3.4" data-path="深入03 对象的属性.html">
            
                <a href="深入03 对象的属性.html#即时生成属性的其他方式">
            
                    
                    即时生成属性的其他方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.3.5" data-path="深入03 对象的属性.html">
            
                <a href="深入03 对象的属性.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.1.4" data-path="深入04 闭包.html">
            
                <a href="深入04 闭包.html">
            
                    
                    深入04 闭包
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.4.1" data-path="深入04 闭包.html">
            
                <a href="深入04 闭包.html#函数对象的作用域">
            
                    
                    函数对象的作用域
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.4.2" data-path="深入04 闭包.html">
            
                <a href="深入04 闭包.html#闭包">
            
                    
                    闭包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.4.3" data-path="深入04 闭包.html">
            
                <a href="深入04 闭包.html#闭包与并行运算">
            
                    
                    闭包与并行运算
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.1.5" data-path="深入05 装饰器.html">
            
                <a href="深入05 装饰器.html">
            
                    
                    深入05 装饰器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.5.1" data-path="深入05 装饰器.html">
            
                <a href="深入05 装饰器.html#装饰函数和方法">
            
                    
                    装饰函数和方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.5.2" data-path="深入05 装饰器.html">
            
                <a href="深入05 装饰器.html#含参的装饰器">
            
                    
                    含参的装饰器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.5.3" data-path="深入05 装饰器.html">
            
                <a href="深入05 装饰器.html#装饰类">
            
                    
                    装饰类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.5.4" data-path="深入05 装饰器.html">
            
                <a href="深入05 装饰器.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.1.6" data-path="深入06 内存管理.html">
            
                <a href="深入06 内存管理.html">
            
                    
                    深入06 内存管理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.6.1" data-path="深入06 内存管理.html">
            
                <a href="深入06 内存管理.html#对象的内存使用">
            
                    
                    对象的内存使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.6.2" data-path="深入06 内存管理.html">
            
                <a href="深入06 内存管理.html#对象引用对象">
            
                    
                    对象引用对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.6.3" data-path="深入06 内存管理.html">
            
                <a href="深入06 内存管理.html#引用减少">
            
                    
                    引用减少
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.6.4" data-path="深入06 内存管理.html">
            
                <a href="深入06 内存管理.html#垃圾回收">
            
                    
                    垃圾回收
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.6.5" data-path="深入06 内存管理.html">
            
                <a href="深入06 内存管理.html#分代回收">
            
                    
                    分代回收
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.6.6" data-path="深入06 内存管理.html">
            
                <a href="深入06 内存管理.html#孤立的引用环">
            
                    
                    孤立的引用环
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.6.7" data-path="深入06 内存管理.html">
            
                <a href="深入06 内存管理.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">Python补充</li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="补充.html">
            
                <a href="补充.html">
            
                    
                    Python补充
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.1" data-path="补充01 序列的方法.html">
            
                <a href="补充01 序列的方法.html">
            
                    
                    补充01 序列的方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html">
            
                    
                    补充02 小技巧
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.2.1" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html#import模块">
            
                    
                    import模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2.2" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html#查询">
            
                    
                    查询
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2.3" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html#使用中文以及其它非ascii编码">
            
                    
                    使用中文(以及其它非ASCII编码)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2.4" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html#表示2进制，8进制和16进制数字">
            
                    
                    表示2进制，8进制和16进制数字
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2.5" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html#注释">
            
                    
                    注释
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2.6" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html#搜索路径">
            
                    
                    搜索路径
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2.7" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html#脚本与命令行结合">
            
                    
                    脚本与命令行结合
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2.8" data-path="补充02 小技巧.html">
            
                <a href="补充02 小技巧.html#安装非标准包">
            
                    
                    安装非标准包
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.1.3" data-path="补充03 内置函数清单.html">
            
                <a href="补充03 内置函数清单.html">
            
                    
                    补充03 内置函数清单
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.3.1" data-path="补充03 内置函数清单.html">
            
                <a href="补充03 内置函数清单.html#数学运算">
            
                    
                    数学运算
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.3.2" data-path="补充03 内置函数清单.html">
            
                <a href="补充03 内置函数清单.html#类型转换">
            
                    
                    类型转换
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.3.3" data-path="补充03 内置函数清单.html">
            
                <a href="补充03 内置函数清单.html#类，对象，属性">
            
                    
                    序列操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.3.4" data-path="补充03 内置函数清单.html">
            
                <a href="补充03 内置函数清单.html#编译，执行">
            
                    
                    编译，执行
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.3.5" data-path="补充03 内置函数清单.html">
            
                <a href="补充03 内置函数清单.html#其他">
            
                    
                    其他
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.1.4" data-path="补充04 简史.html">
            
                <a href="补充04 简史.html">
            
                    
                    补充04 简史
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.4.1" data-path="补充04 简史.html">
            
                <a href="补充04 简史.html#python的起源">
            
                    
                    Python的起源
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.4.2" data-path="补充04 简史.html">
            
                <a href="补充04 简史.html#python的诞生">
            
                    
                    Python的诞生
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.4.3" data-path="补充04 简史.html">
            
                <a href="补充04 简史.html#python启示录">
            
                    
                    Python启示录
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.1.5" data-path="补充05 字符串格式化.html">
            
                <a href="补充05 字符串格式化.html">
            
                    
                    补充05 字符串格式化 (%操作符)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.5.1" data-path="补充05 字符串格式化.html">
            
                <a href="补充05 字符串格式化.html#模板">
            
                    
                    模板
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.5.2" data-path="补充05 字符串格式化.html">
            
                <a href="补充05 字符串格式化.html#格式符">
            
                    
                    格式符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.5.3" data-path="补充05 字符串格式化.html">
            
                <a href="补充05 字符串格式化.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.1.6" data-path="补充06 python之道.html">
            
                <a href="补充06 python之道.html">
            
                    
                    补充06 Python之道
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.6.1" data-path="补充06 python之道.html">
            
                <a href="补充06 python之道.html#历史">
            
                    
                    历史
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">Python标准库</li>
        
        
    
        <li class="chapter " data-level="5.1" data-path="标准库.html">
            
                <a href="标准库.html">
            
                    
                    Python标准库
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.1" data-path="标准库——走马观花.html">
            
                <a href="标准库——走马观花.html">
            
                    
                    标准库——走马观花
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.1.1" data-path="标准库——走马观花.html">
            
                <a href="标准库——走马观花.html#第一类：python增强">
            
                    
                    第一类：Python增强
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.1.2" data-path="标准库——走马观花.html">
            
                <a href="标准库——走马观花.html#第二类：系统互动">
            
                    
                    第二类：系统互动
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.1.3" data-path="标准库——走马观花.html">
            
                <a href="标准库——走马观花.html#第三类：网络">
            
                    
                    第三类：网络
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.2" data-path="标准库的学习准备.html">
            
                <a href="标准库的学习准备.html">
            
                    
                    标准库的学习准备
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.2.1" data-path="标准库的学习准备.html">
            
                <a href="标准库的学习准备.html#硬件原理">
            
                    
                    硬件原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.2.2" data-path="标准库的学习准备.html">
            
                <a href="标准库的学习准备.html#操作系统">
            
                    
                    操作系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.2.3" data-path="标准库的学习准备.html">
            
                <a href="标准库的学习准备.html#网络">
            
                    
                    网络
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.2.4" data-path="标准库的学习准备.html">
            
                <a href="标准库的学习准备.html#算法与数据结构">
            
                    
                    算法与数据结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.2.5" data-path="标准库的学习准备.html">
            
                <a href="标准库的学习准备.html#数据库">
            
                    
                    数据库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.2.6" data-path="标准库的学习准备.html">
            
                <a href="标准库的学习准备.html#加密和文本编码">
            
                    
                    加密和文本编码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.2.7" data-path="标准库的学习准备.html">
            
                <a href="标准库的学习准备.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.3" data-path="STL01.html">
            
                <a href="STL01.html">
            
                    
                    标准库01 正则表达式 (re包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.3.1" data-path="STL01.html">
            
                <a href="STL01.html#语法">
            
                    
                    语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.3.2" data-path="STL01.html">
            
                <a href="STL01.html#正则表达式的函数">
            
                    
                    正则表达式的函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.3.3" data-path="STL01.html">
            
                <a href="STL01.html#写一个正则表达式">
            
                    
                    写一个正则表达式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.3.4" data-path="STL01.html">
            
                <a href="STL01.html#对比research和rematch">
            
                    
                    对比re.search和re.match
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.3.5" data-path="STL01.html">
            
                <a href="STL01.html#练习">
            
                    
                    练习
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.3.6" data-path="STL01.html">
            
                <a href="STL01.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.4" data-path="STL02.html">
            
                <a href="STL02.html">
            
                    
                    标准库02 时间与日期 (time, datetime包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.4.1" data-path="STL02.html">
            
                <a href="STL02.html#time包">
            
                    
                    time包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.4.2" data-path="STL02.html">
            
                <a href="STL02.html#datetime包">
            
                    
                    datetime包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.4.3" data-path="STL02.html">
            
                <a href="STL02.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.5" data-path="STL03.html">
            
                <a href="STL03.html">
            
                    
                    标准库03 路径与文件 (os.path包, glob包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.5.1" data-path="STL03.html">
            
                <a href="STL03.html#ospath包">
            
                    
                    os.path包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.5.2" data-path="STL03.html">
            
                <a href="STL03.html#glob包">
            
                    
                    glob包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.5.3" data-path="STL03.html">
            
                <a href="STL03.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.6" data-path="STL04.html">
            
                <a href="STL04.html">
            
                    
                    标准库04 文件管理 (部分os包，shutil包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.6.1" data-path="STL04.html">
            
                <a href="STL04.html#os包">
            
                    
                    os包
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.7" data-path="STL05.html">
            
                <a href="STL05.html">
            
                    
                    标准库05 存储对象 (pickle包，cPickle包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.7.1" data-path="STL05.html">
            
                <a href="STL05.html#pickle包">
            
                    
                    pickle包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.7.2" data-path="STL05.html">
            
                <a href="STL05.html#cpickle包">
            
                    
                    cPickle包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.7.3" data-path="STL05.html">
            
                <a href="STL05.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.8" data-path="STL06.html">
            
                <a href="STL06.html">
            
                    
                    标准库06 子进程 (subprocess包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.8.1" data-path="STL06.html">
            
                <a href="STL06.html#subprocess以及常用的封装函数">
            
                    
                    subprocess以及常用的封装函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.8.2" data-path="STL06.html">
            
                <a href="STL06.html#popen(">
            
                    
                    Popen()
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.8.3" data-path="STL06.html">
            
                <a href="STL06.html#子进程的文本流控制">
            
                    
                    子进程的文本流控制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.8.4" data-path="STL06.html">
            
                <a href="STL06.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.9" data-path="STL07.html">
            
                <a href="STL07.html">
            
                    
                    标准库07 信号 (signal包，部分os包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.9.1" data-path="STL07.html">
            
                <a href="STL07.html#定义信号名">
            
                    
                    定义信号名
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.9.2" data-path="STL07.html">
            
                <a href="STL07.html#预设信号处理函数">
            
                    
                    预设信号处理函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.9.3" data-path="STL07.html">
            
                <a href="STL07.html#定时发出sigalrm信号">
            
                    
                    定时发出SIGALRM信号
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.9.4" data-path="STL07.html">
            
                <a href="STL07.html#发送信号">
            
                    
                    发送信号
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.9.5" data-path="STL07.html">
            
                <a href="STL07.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.10" data-path="STL08.html">
            
                <a href="STL08.html">
            
                    
                    标准库08 多线程与同步 (threading包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.10.1" data-path="STL08.html">
            
                <a href="STL08.html#多线程售票以及同步">
            
                    
                    多线程售票以及同步
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.10.2" data-path="STL08.html">
            
                <a href="STL08.html#oop创建线程">
            
                    
                    OOP创建线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.10.3" data-path="STL08.html">
            
                <a href="STL08.html#其他">
            
                    
                    其他
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.10.4" data-path="STL08.html">
            
                <a href="STL08.html#练习">
            
                    
                    练习
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.10.5" data-path="STL08.html">
            
                <a href="STL08.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.11" data-path="STL09.html">
            
                <a href="STL09.html">
            
                    
                    标准库09 当前进程信息 (部分os包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.11.1" data-path="STL09.html">
            
                <a href="STL09.html#进程信息">
            
                    
                    进程信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.11.2" data-path="STL09.html">
            
                <a href="STL09.html#saved-uid和saved-gid">
            
                    
                    saved UID和saved GID
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.11.3" data-path="STL09.html">
            
                <a href="STL09.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.12" data-path="STL10.html">
            
                <a href="STL10.html">
            
                    
                    标准库10 多进程初步 (multiprocessing包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.12.1" data-path="STL10.html">
            
                <a href="STL10.html#threading和multiprocessing">
            
                    
                    threading和multiprocessing
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.12.2" data-path="STL10.html">
            
                <a href="STL10.html#Pipe和Queue">
            
                    
                    Pipe和Queue
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.12.3" data-path="STL10.html">
            
                <a href="STL10.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.13" data-path="STL11.html">
            
                <a href="STL11.html">
            
                    
                    标准库11 多进程探索 (multiprocessing包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.13.1" data-path="STL11.html">
            
                <a href="STL11.html#进程池">
            
                    
                    进程池
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.13.2" data-path="STL11.html">
            
                <a href="STL11.html#练习">
            
                    
                    练习
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.13.3" data-path="STL11.html">
            
                <a href="STL11.html#共享资源">
            
                    
                    共享资源
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.13.3.1" data-path="STL11.html">
            
                <a href="STL11.html#共享内存">
            
                    
                    共享内存
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.13.3.2" data-path="STL11.html">
            
                <a href="STL11.html#manager">
            
                    
                    Manager
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.13.4" data-path="STL11.html">
            
                <a href="STL11.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.14" data-path="STL12.html">
            
                <a href="STL12.html">
            
                    
                    标准库12 数学与随机数 (math包，random包)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.14.1" data-path="STL12.html">
            
                <a href="STL12.html#math包">
            
                    
                    math包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.14.2" data-path="STL12.html">
            
                <a href="STL12.html#random包">
            
                    
                    random包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.14.3" data-path="STL12.html">
            
                <a href="STL12.html#练习">
            
                    
                    练习
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.14.4" data-path="STL12.html">
            
                <a href="STL12.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.15" data-path="STL13 循环器 itertools.html">
            
                <a href="STL13 循环器 itertools.html">
            
                    
                    标准库13 循环器 (itertools)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.15.1" data-path="STL13 循环器 itertools.html">
            
                <a href="STL13 循环器 itertools.html#无穷循环器">
            
                    
                    无穷循环器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.15.2" data-path="STL13 循环器 itertools.html">
            
                <a href="STL13 循环器 itertools.html#函数式工具">
            
                    
                    函数式工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.15.3" data-path="STL13 循环器 itertools.html">
            
                <a href="STL13 循环器 itertools.html#组合工具">
            
                    
                    组合工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.15.4" data-path="STL13 循环器 itertools.html">
            
                <a href="STL13 循环器 itertools.html#groupby">
            
                    
                    groupby()
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.15.5" data-path="STL13 循环器 itertools.html">
            
                <a href="STL13 循环器 itertools.html#其它工具">
            
                    
                    其它工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.15.6" data-path="STL13 循环器 itertools.html">
            
                <a href="STL13 循环器 itertools.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.1.16" data-path="STL14 数据库 sqlite3.html">
            
                <a href="STL14 数据库 sqlite3.html">
            
                    
                    标准库14 数据库 (sqlite3)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.16.1" data-path="STL14 数据库 sqlite3.html">
            
                <a href="STL14 数据库 sqlite3.html#创建数据库">
            
                    
                    创建数据库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.16.2" data-path="STL14 数据库 sqlite3.html">
            
                <a href="STL14 数据库 sqlite3.html#插入数据">
            
                    
                    插入数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.16.3" data-path="STL14 数据库 sqlite3.html">
            
                <a href="STL14 数据库 sqlite3.html#查询">
            
                    
                    查询
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.16.4" data-path="STL14 数据库 sqlite3.html">
            
                <a href="STL14 数据库 sqlite3.html#更新与删除">
            
                    
                    更新与删除
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.16.5" data-path="STL14 数据库 sqlite3.html">
            
                <a href="STL14 数据库 sqlite3.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">Python应用</li>
        
        
    
        <li class="chapter " data-level="6.1" data-path="应用.html">
            
                <a href="应用.html">
            
                    
                    Python应用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1.1" data-path="网络01 原始服务器.html">
            
                <a href="网络01 原始服务器.html">
            
                    
                    应用01 原始服务器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1.1.1" data-path="网络01 原始服务器.html">
            
                <a href="网络01 原始服务器.html#tcpip和socket">
            
                    
                    TCP/IP和socket
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.1.2" data-path="网络01 原始服务器.html">
            
                <a href="网络01 原始服务器.html#tcp-socket">
            
                    
                    TCP socket
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.1.3" data-path="网络01 原始服务器.html">
            
                <a href="网络01 原始服务器.html#基于tcp-socket的http服务器">
            
                    
                    基于TCP socket的HTTP服务器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.1.4" data-path="网络01 原始服务器.html">
            
                <a href="网络01 原始服务器.html#深入http服务器程序">
            
                    
                    深入HTTP服务器程序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.1.5" data-path="网络01 原始服务器.html">
            
                <a href="网络01 原始服务器.html#使用浏览器实验">
            
                    
                    使用浏览器实验
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.1.6" data-path="网络01 原始服务器.html">
            
                <a href="网络01 原始服务器.html#探索的方向">
            
                    
                    探索的方向
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6.1.2" data-path="网络02 服务器进化.html">
            
                <a href="网络02 服务器进化.html">
            
                    
                    应用02 服务器进化
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1.2.1" data-path="网络02 服务器进化.html">
            
                <a href="网络02 服务器进化.html#支持post">
            
                    
                    支持POST
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.2.2" data-path="网络02 服务器进化.html">
            
                <a href="网络02 服务器进化.html#使用socketserver">
            
                    
                    使用SocketServer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.2.3" data-path="网络02 服务器进化.html">
            
                <a href="网络02 服务器进化.html#simplehttpserver:-使用静态文件来回应请求">
            
                    
                    SimpleHTTPServer: 使用静态文件来回应请求
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.2.4" data-path="网络02 服务器进化.html">
            
                <a href="网络02 服务器进化.html#cgihttpserver：使用静态文件或者cgi来回应请求">
            
                    
                    CGIHTTPServer：使用静态文件或者CGI来回应请求
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.2.5" data-path="网络02 服务器进化.html">
            
                <a href="网络02 服务器进化.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6.1.3" data-path="网络03 使用pyqt制作视频播放器.html">
            
                <a href="网络03 使用pyqt制作视频播放器.html">
            
                    
                    应用03 使用PyQT制作视频播放器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1.3.1" data-path="网络03 使用pyqt制作视频播放器.html">
            
                <a href="网络03 使用pyqt制作视频播放器.html#视频播放器">
            
                    
                    视频播放器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.3.2" data-path="网络03 使用pyqt制作视频播放器.html">
            
                <a href="网络03 使用pyqt制作视频播放器.html#视图部分">
            
                    
                    视图部分
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.3.3" data-path="网络03 使用pyqt制作视频播放器.html">
            
                <a href="网络03 使用pyqt制作视频播放器.html#多线程">
            
                    
                    多线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.3.4" data-path="网络03 使用pyqt制作视频播放器.html">
            
                <a href="网络03 使用pyqt制作视频播放器.html#信号与槽">
            
                    
                    信号与槽
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">被解放的姜戈</li>
        
        
    
        <li class="chapter " data-level="7.1" data-path="被解放的姜戈.html">
            
                <a href="被解放的姜戈.html">
            
                    
                    被解放的姜戈
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.1" data-path="被解放的姜戈01 初试天涯.html">
            
                <a href="被解放的姜戈01 初试天涯.html">
            
                    
                    被解放的姜戈01 初试天涯
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.1.1" data-path="被解放的姜戈01 初试天涯.html">
            
                <a href="被解放的姜戈01 初试天涯.html#安装django">
            
                    
                    安装Django
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.1.2" data-path="被解放的姜戈01 初试天涯.html">
            
                <a href="被解放的姜戈01 初试天涯.html#启动">
            
                    
                    启动
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.1.3" data-path="被解放的姜戈01 初试天涯.html">
            
                <a href="被解放的姜戈01 初试天涯.html#第一个网页">
            
                    
                    第一个网页
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.1.4" data-path="被解放的姜戈01 初试天涯.html">
            
                <a href="被解放的姜戈01 初试天涯.html#增加app">
            
                    
                    增加app
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.1.5" data-path="被解放的姜戈01 初试天涯.html">
            
                <a href="被解放的姜戈01 初试天涯.html#增加app页面">
            
                    
                    增加APP页面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.1.6" data-path="被解放的姜戈01 初试天涯.html">
            
                <a href="被解放的姜戈01 初试天涯.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.1.2" data-path="被解放的姜戈02 庄园疑云.html">
            
                <a href="被解放的姜戈02 庄园疑云.html">
            
                    
                    被解放的姜戈02 庄园疑云
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.2.1" data-path="被解放的姜戈02 庄园疑云.html">
            
                <a href="被解放的姜戈02 庄园疑云.html#连接数据库">
            
                    
                    连接数据库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.2.2" data-path="被解放的姜戈02 庄园疑云.html">
            
                <a href="被解放的姜戈02 庄园疑云.html#创立模型">
            
                    
                    创立模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.2.3" data-path="被解放的姜戈02 庄园疑云.html">
            
                <a href="被解放的姜戈02 庄园疑云.html#显示数据">
            
                    
                    显示数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.2.4" data-path="被解放的姜戈02 庄园疑云.html">
            
                <a href="被解放的姜戈02 庄园疑云.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.1.3" data-path="被解放的姜戈03 所谓伊人.html">
            
                <a href="被解放的姜戈03 所谓伊人.html">
            
                    
                    被解放的姜戈03 所谓伊人
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.3.1" data-path="被解放的姜戈03 所谓伊人.html">
            
                <a href="被解放的姜戈03 所谓伊人.html#模板初体验">
            
                    
                    模板初体验
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.3.2" data-path="被解放的姜戈03 所谓伊人.html">
            
                <a href="被解放的姜戈03 所谓伊人.html#流程">
            
                    
                    流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.3.3" data-path="被解放的姜戈03 所谓伊人.html">
            
                <a href="被解放的姜戈03 所谓伊人.html#循环与选择">
            
                    
                    循环与选择
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.3.4" data-path="被解放的姜戈03 所谓伊人.html">
            
                <a href="被解放的姜戈03 所谓伊人.html#模板继承">
            
                    
                    模板继承
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.3.5" data-path="被解放的姜戈03 所谓伊人.html">
            
                <a href="被解放的姜戈03 所谓伊人.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.1.4" data-path="被解放的姜戈04 各取所需.html">
            
                <a href="被解放的姜戈04 各取所需.html">
            
                    
                    被解放的姜戈04 各取所需
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.4.1" data-path="被解放的姜戈04 各取所需.html">
            
                <a href="被解放的姜戈04 各取所需.html#html表格">
            
                    
                    html表格
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.4.2" data-path="被解放的姜戈04 各取所需.html">
            
                <a href="被解放的姜戈04 各取所需.html#post方法">
            
                    
                    POST方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.4.3" data-path="被解放的姜戈04 各取所需.html">
            
                <a href="被解放的姜戈04 各取所需.html#存储数据">
            
                    
                    存储数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.4.4" data-path="被解放的姜戈04 各取所需.html">
            
                <a href="被解放的姜戈04 各取所需.html#表格对象">
            
                    
                    表格对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.4.5" data-path="被解放的姜戈04 各取所需.html">
            
                <a href="被解放的姜戈04 各取所需.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.1.5" data-path="被解放的姜戈05 黑面管家.html">
            
                <a href="被解放的姜戈05 黑面管家.html">
            
                    
                    被解放的姜戈05 黑面管家
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.5.1" data-path="被解放的姜戈05 黑面管家.html">
            
                <a href="被解放的姜戈05 黑面管家.html#默认界面">
            
                    
                    默认界面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.5.2" data-path="被解放的姜戈05 黑面管家.html">
            
                <a href="被解放的姜戈05 黑面管家.html#复杂模型">
            
                    
                    复杂模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.5.3" data-path="被解放的姜戈05 黑面管家.html">
            
                <a href="被解放的姜戈05 黑面管家.html#自定义页面">
            
                    
                    自定义页面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.5.4" data-path="被解放的姜戈05 黑面管家.html">
            
                <a href="被解放的姜戈05 黑面管家.html#inline显示">
            
                    
                    Inline显示
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.5.5" data-path="被解放的姜戈05 黑面管家.html">
            
                <a href="被解放的姜戈05 黑面管家.html#列表页的显示">
            
                    
                    列表页的显示
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.5.6" data-path="被解放的姜戈05 黑面管家.html">
            
                <a href="被解放的姜戈05 黑面管家.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.1.6" data-path="被解放的姜戈06 假作真时.html">
            
                <a href="被解放的姜戈06 假作真时.html">
            
                    
                    被解放的姜戈06 假作真时
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.6.1" data-path="被解放的姜戈06 假作真时.html">
            
                <a href="被解放的姜戈06 假作真时.html#创建用户">
            
                    
                    创建用户
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.6.2" data-path="被解放的姜戈06 假作真时.html">
            
                <a href="被解放的姜戈06 假作真时.html#用户登录">
            
                    
                    用户登录
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.6.3" data-path="被解放的姜戈06 假作真时.html">
            
                <a href="被解放的姜戈06 假作真时.html#登出">
            
                    
                    登出
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.6.4" data-path="被解放的姜戈06 假作真时.html">
            
                <a href="被解放的姜戈06 假作真时.html#viewspy中的用户">
            
                    
                    views.py中的用户
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.6.5" data-path="被解放的姜戈06 假作真时.html">
            
                <a href="被解放的姜戈06 假作真时.html#模板中的用户">
            
                    
                    模板中的用户
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.6.6" data-path="被解放的姜戈06 假作真时.html">
            
                <a href="被解放的姜戈06 假作真时.html#用户注册">
            
                    
                    用户注册
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.6.7" data-path="被解放的姜戈06 假作真时.html">
            
                <a href="被解放的姜戈06 假作真时.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.1.7" data-path="被解放的姜戈07 马不停蹄.html">
            
                <a href="被解放的姜戈07 马不停蹄.html">
            
                    
                    被解放的姜戈07 马不停蹄
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.7.1" data-path="被解放的姜戈07 马不停蹄.html">
            
                <a href="被解放的姜戈07 马不停蹄.html#安装">
            
                    
                    安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.7.2" data-path="被解放的姜戈07 马不停蹄.html">
            
                <a href="被解放的姜戈07 马不停蹄.html#静态文件">
            
                    
                    静态文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.7.3" data-path="被解放的姜戈07 马不停蹄.html">
            
                <a href="被解放的姜戈07 马不停蹄.html#其它">
            
                    
                    其它
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.7.4" data-path="被解放的姜戈07 马不停蹄.html">
            
                <a href="被解放的姜戈07 马不停蹄.html#总结">
            
                    
                    总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.1.8" data-path="被解放的姜戈08 远走高飞.html">
            
                <a href="被解放的姜戈08 远走高飞.html">
            
                    
                    被解放的姜戈08 远走高飞
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1.8.1" data-path="被解放的姜戈08 远走高飞.html">
            
                <a href="被解放的姜戈08 远走高飞.html#阿里云准备">
            
                    
                    阿里云准备
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.8.2" data-path="被解放的姜戈08 远走高飞.html">
            
                <a href="被解放的姜戈08 远走高飞.html#安装django">
            
                    
                    安装Django
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.8.3" data-path="被解放的姜戈08 远走高飞.html">
            
                <a href="被解放的姜戈08 远走高飞.html#安装数据库和http服务器">
            
                    
                    安装数据库和HTTP服务器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.1.8.4" data-path="被解放的姜戈08 远走高飞.html">
            
                <a href="被解放的姜戈08 远走高飞.html#运行django服务器">
            
                    
                    运行Django服务器
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="尾声.html">
            
                <a href="尾声.html">
            
                    
                    快速教程 尾声
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >基础04 运算</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="python&#x57FA;&#x7840;04-&#x8FD0;&#x7B97;">Python&#x57FA;&#x7840;04 &#x8FD0;&#x7B97;</h1>
<p>Python&#x7684;&#x8FD0;&#x7B97;&#x7B26;&#x548C;&#x5176;&#x4ED6;&#x8BED;&#x8A00;&#x7C7B;&#x4F3C;&#x3002;</p>
<p>&#xFF08;&#x6211;&#x4EEC;&#x6682;&#x65F6;&#x53EA;&#x4E86;&#x89E3;&#x8FD9;&#x4E9B;&#x8FD0;&#x7B97;&#x7B26;&#x7684;&#x57FA;&#x672C;&#x7528;&#x6CD5;&#xFF0C;&#x65B9;&#x4FBF;&#x6211;&#x4EEC;&#x5C55;&#x5F00;&#x540E;&#x9762;&#x7684;&#x5185;&#x5BB9;&#xFF0C;&#x9AD8;&#x7EA7;&#x5E94;&#x7528;&#x6682;&#x65F6;&#x4E0D;&#x4ECB;&#x7ECD;&#x3002;&#xFF09;</p>
<h2 id="&#x6570;&#x5B66;&#x8FD0;&#x7B97;">&#x6570;&#x5B66;&#x8FD0;&#x7B97;</h2>
<pre><code class="lang-python"><span class="hljs-keyword">print</span> <span class="hljs-number">1</span> + <span class="hljs-number">9</span>        <span class="hljs-comment"># &#x52A0;&#x6CD5;</span>
<span class="hljs-keyword">print</span> <span class="hljs-number">1.3</span> - <span class="hljs-number">4</span>      <span class="hljs-comment"># &#x51CF;&#x6CD5;</span>
<span class="hljs-keyword">print</span> <span class="hljs-number">3</span> * <span class="hljs-number">5</span>        <span class="hljs-comment"># &#x4E58;&#x6CD5;</span>
<span class="hljs-keyword">print</span> <span class="hljs-number">4.5</span> / <span class="hljs-number">1.5</span>    <span class="hljs-comment"># &#x9664;&#x6CD5;</span>
<span class="hljs-keyword">print</span> <span class="hljs-number">3</span> ** <span class="hljs-number">2</span>       <span class="hljs-comment"># &#x4E58;&#x65B9;     </span>
<span class="hljs-keyword">print</span> <span class="hljs-number">10</span> % <span class="hljs-number">3</span>       <span class="hljs-comment"># &#x6C42;&#x4F59;&#x6570;&#xFF08;&#x53D6;&#x6A21;&#x8FD0;&#x7B97;&#xFF1A;-3 % 2 &#x7684;&#x7ED3;&#x679C;&#x4E3A; 1&#xFF09;</span>
</code></pre>
<h2 id="&#x5206;&#x652F;">&#x5206;&#x652F;</h2>
<p>&#x5224;&#x65AD;&#x662F;&#x771F;&#x8FD8;&#x662F;&#x5047;&#xFF0C;&#x8FD4;&#x56DE;True/False&#x3002;</p>
<pre><code class="lang-python"><span class="hljs-keyword">print</span> <span class="hljs-number">5</span> == <span class="hljs-number">6</span>               <span class="hljs-comment"># &#x76F8;&#x7B49;</span>
<span class="hljs-keyword">print</span> <span class="hljs-number">8.0</span> != <span class="hljs-number">8.0</span>           <span class="hljs-comment"># &#x4E0D;&#x7B49;</span>
<span class="hljs-keyword">print</span> <span class="hljs-number">3</span> &lt; <span class="hljs-number">3</span>                <span class="hljs-comment"># &#x5C0F;&#x4E8E;</span>
<span class="hljs-keyword">print</span> <span class="hljs-number">3</span> &lt;= <span class="hljs-number">3</span>               <span class="hljs-comment"># &#x5C0F;&#x4E8E;&#x6216;&#x7B49;&#x4E8E;</span>
<span class="hljs-keyword">print</span> <span class="hljs-number">4</span> &gt; <span class="hljs-number">5</span>                <span class="hljs-comment"># &#x5927;&#x4E8E;</span>
<span class="hljs-keyword">print</span> <span class="hljs-number">4</span> &gt;= <span class="hljs-number">0</span>               <span class="hljs-comment"># &#x5927;&#x4E8E;&#x6216;&#x7B49;&#x4E8E;</span>
<span class="hljs-keyword">print</span> <span class="hljs-number">5</span> <span class="hljs-keyword">in</span> [<span class="hljs-number">1</span>, <span class="hljs-number">3</span>, <span class="hljs-number">5</span>]       <span class="hljs-comment"># 5&#x662F;&#x5217;&#x8868;&#xFF08;list&#xFF09;[1,3,5]&#x4E2D;&#x7684;&#x4E00;&#x4E2A;&#x5143;&#x7D20;</span>
</code></pre>
<p>&#xFF08;&#x8FD8;&#x6709;<code>is</code>&#x3001;<code>is not</code>&#x7B49;&#xFF0C;&#x6682;&#x65F6;&#x4E0D;&#x6DF1;&#x5165;&#xFF09; </p>
<h2 id="&#x903B;&#x8F91;&#x8FD0;&#x7B97;">&#x903B;&#x8F91;&#x8FD0;&#x7B97;</h2>
<p><code>True</code>/<code>False</code>&#x4E4B;&#x95F4;&#x7684;&#x8FD0;&#x7B97;&#xFF1A;</p>
<pre><code class="lang-python"><span class="hljs-keyword">print</span> <span class="hljs-keyword">True</span> <span class="hljs-keyword">and</span> <span class="hljs-keyword">True</span>, <span class="hljs-keyword">True</span> <span class="hljs-keyword">and</span> <span class="hljs-keyword">False</span>      <span class="hljs-comment"># and&#xFF1A; &#x201C;&#x4E0E;&#x201D;&#x8FD0;&#x7B97;&#xFF0C;&#x4E24;&#x8005;&#x90FD;&#x4E3A;&#x771F;&#x624D;&#x662F;&#x771F;&#x3002;</span>
<span class="hljs-keyword">print</span> <span class="hljs-keyword">True</span> <span class="hljs-keyword">or</span> <span class="hljs-keyword">False</span>                      <span class="hljs-comment"># or&#xFF1A;  &#x201D;&#x6216;&#x201C;&#x8FD0;&#x7B97;&#xFF0C;&#x5176;&#x4E2D;&#x4E4B;&#x4E00;&#x4E3A;&#x771F;&#x5373;&#x4E3A;&#x771F;&#x3002;</span>
<span class="hljs-keyword">print</span> <span class="hljs-keyword">not</span> <span class="hljs-keyword">True</span>                           <span class="hljs-comment"># not&#xFF1A; &#x201C;&#x975E;&#x201D;&#x8FD0;&#x7B97;&#xFF0C;&#x53D6;&#x53CD;&#x3002;</span>
<span class="hljs-keyword">print</span> <span class="hljs-number">5</span> == <span class="hljs-number">6</span> <span class="hljs-keyword">or</span> <span class="hljs-number">3</span> &gt;= <span class="hljs-number">3</span>                   <span class="hljs-comment"># &#x7ED3;&#x5408;&#x4E0A;&#x4E00;&#x5C0F;&#x8282;&#x5185;&#x5BB9;</span>
</code></pre>
<h2 id="pythonic-&#x6570;&#x636E;&#x4EA4;&#x6362;">Pythonic &#x6570;&#x636E;&#x4EA4;&#x6362;</h2>
<p>&#x968F;&#x7740;&#x65F6;&#x95F4;&#x7684;&#x63A8;&#x79FB;&#xFF0C;Python&#x8BED;&#x8A00;&#x4E0D;&#x65AD;&#x6F14;&#x8FDB;&#xFF0C;&#x793E;&#x533A;&#x4E0D;&#x65AD;&#x6210;&#x957F;&#xFF0C;&#x6D8C;&#x73B0;&#x4E86;&#x8BB8;&#x591A;&#x5173;&#x4E8E;&#x5982;&#x4F55;&#x6B63;&#x786E;&#x5730;&#x4F7F;&#x7528; Python &#x7684; ideas&#x3002;</p>
<p>Pythonic&#x53EF;&#x4EE5;&#x7406;&#x89E3;&#x4E3A;&#xFF1A;&#x53EA;&#x6709;Python&#x80FD;&#x505A;&#x5230;&#x7684;&#xFF0C;&#x533A;&#x522B;&#x4E8E;&#x5176;&#x4ED6;&#x8BED;&#x8A00;&#x7684;&#x5199;&#x6CD5;&#xFF0C;&#x5176;&#x5B9E;&#x5C31;&#x662F;Python&#x7684;&#x60EF;&#x7528;&#x548C;&#x7279;&#x6709;&#x5199;&#x6CD5;&#x3002;&#x540E;&#x7EED;&#x6BCF;&#x8282;&#x4F1A;&#x63D2;&#x5165;&#x8FD9;&#x6837;&#x7684;&#x60EF;&#x7528;&#x6CD5;&#x3002;</p>
<p>&#x5728;Python&#x4E2D;&#x8FDB;&#x884C;&#x4E24;&#x4E2A;&#x503C;&#x7684;&#x4EA4;&#x6362;&#xFF0C;&#x63A8;&#x8350;&#x8FD9;&#x6837;&#x5199;&#xFF1A;</p>
<pre><code class="lang-python">a = <span class="hljs-number">3</span>
b = <span class="hljs-number">5</span>
a,b = b,a
</code></pre>
<p>&#x800C;&#x5728;&#x5176;&#x5B83;&#x7684;&#x8BED;&#x8A00;&#x4E2D;&#xFF0C;&#x4E3A;&#x4E86;&#x4EA4;&#x6362;&#x4E24;&#x4E2A;&#x503C;&#xFF0C;&#x6211;&#x4EEC;&#x901A;&#x5E38;&#x9700;&#x8981;&#x501F;&#x52A9;&#x7B2C;&#x4E09;&#x4E2A;&#x4E34;&#x65F6;&#x53D8;&#x91CF;&#xFF1A;</p>
<pre><code class="lang-python">tmp = a
a = b
b = tmp
</code></pre>
<h2 id="&#x603B;&#x7ED3;">&#x603B;&#x7ED3;</h2>
<p>&#x6570;&#x5B66;&#x8FD0;&#x7B97;&#xFF1A;  <code>+</code>&#x3001;<code>-</code>&#x3001;<code>*</code>&#x3001;<code>/</code>&#x3001;<code>**</code>&#x3001;<code>%</code>&#x3002;</p>
<p>&#x6BD4;&#x8F83;&#x53CA;&#x5224;&#x65AD;&#xFF1A;<code>==</code>&#x3001;<code>!=</code>&#x3001;<code>&gt;</code>&#x3001;<code>&gt;=</code>&#x3001;<code>&lt;</code>&#x3001;<code>&lt;=</code>&#xFF1B;<code>in</code>&#x3002;</p>
<p>&#x903B;&#x8F91;&#x8FD0;&#x7B97;&#xFF1A;  <code>and</code>&#x3001;<code>or</code>&#x3001;<code>not</code>&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="03.html#总结" class="navigation navigation-prev " aria-label="Previous page: 总结">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="04.html#数学运算" class="navigation navigation-next " aria-label="Next page: 数学运算">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"基础04 运算","level":"1.2.4","depth":2,"next":{"title":"数学运算","level":"1.2.4.1","depth":3,"anchor":"#数学运算","path":"04.md","ref":"04.md#数学运算","articles":[]},"previous":{"title":"总结","level":"1.2.3.5","depth":3,"anchor":"#总结","path":"03.md","ref":"03.md#总结","articles":[]},"dir":"ltr"},"config":{"plugins":["toggle-chapters","theme-comscore","livereload"],"root":"./content","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"theme-comscore":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"toggle-chapters":{}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Python-Tutorial","language":"zh-hans","gitbook":"*","description":"A Quick Tutorial of Python"},"file":{"path":"04.md","mtime":"2018-01-14T19:22:18.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-03-22T11:11:10.529Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-theme-comscore/test.js"></script>
        
    

    </body>
</html>

